import { lazy } from "react";

export const routerList = [
  {
    path: "/home/recommended",
    element: lazy(() => import("@/pages/Recommended")),
  },
  {
    path: "/home/creating",
    element: lazy(() => import("@/pages/Creating")),
  },
  {
    path: "/home/preference",
    element: lazy(() => import("@/pages/Preference")),
  },
  {
    path: "/home/collection",
    element: lazy(() => import("@/pages/Collection")),
  },
];

const routes = [
  {
    path: "/",
    to: "/home/recommended",
  },
  {
    path: "/home",
    name: "Home",
    element: lazy(() => import("@/pages/Home")),
    children: routerList,
  },
  {
    path: "/login",
    element: lazy(() => import("@/pages/Login")),
  },
  {
    path: "*",
    element: lazy(() => import("@/pages/Error")),
  },

  // 一级路由
  {
    path: "/h5",
    element: lazy(() => import("@/pages/H5")),
  },
  {
    path: "/home/workbench",
    element: lazy(() => import("@/pages/Workbench")),
  },
];

export default routes;
